<?php
/**
 * Created by PhpStorm.
 * User: HXL
 * Date: 2017/11/15
 * Time: 16:57
 */
namespace app\orders\model;

use think\Db;

class Roles extends BaseModel
{
    protected $tableName = 'ari_roles';

    public function search($where){
        $search = Db::table($this->tableName)->where($where)->select();
        return $search;
    }

    public function searchLike($search){
        $num = 10;
        $count = Db::table($this->tableName)->where('role_name', 'like', "%$search%")->whereOr('remark', 'like', "%$search%")
            ->count();
        $data = Db::table($this->tableName)->where('role_name', 'like', "%$search%")->whereOr('remark', 'like', "%$search%")
            ->paginate($num, $count, ['query' => request()->param()]);
        return $data;
    }


}